home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-10 | 26.8 KB | 1,205 lines | [TEXT/MPS ] |
- {***********************************************************
-
- Created: Monday, November 8, 1993 11:57AM
- OCEMessaging.p
- Pascal Interface to the Macintosh Libraries
-
- Copyright Apple Computer, Inc. 1990-1993
- All rights reserved
-
- ***********************************************************}
-
-
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes:= 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT OCEMessaging;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED UsingOCEMessaging}
- {$SETC UsingOCEMessaging:= 1}
-
- {$I+}
- {$SETC OCEMessagingIncludes:= UsingIncludes}
- {$SETC UsingIncludes:= 1}
-
-
- {$IFC UNDEFINED UsingDigitalSignature}
- {$I DigitalSignature.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingFiles}
- {$I $$Shell(PInterfaces)Files.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingOCE}
- {$I OCE.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingOCEAuthDir}
- {$I OCEAuthDir.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingTypes}
- {$I $$Shell(PInterfaces)Types.p}
- {$ENDC}
-
- {$SETC UsingIncludes:= OCEMessagingIncludes}
-
-
-
- {****************************************************************************}
- { Definitions common to OCEMessaging and to OCEMail. These relate to addressing,
- message ids and priorities, etc. }
-
-
- { Values of IPMPriority }
- CONST
- kIPMAnyPriority = 0; { FOR FILTER ONLY }
- kIPMNormalPriority = 1;
-
-
-
- TYPE
- IPMPriority = Byte;
-
-
- CONST
- { Values of IPMAccessMode }
- kIPMAtMark = 0;
- kIPMFromStart = 1;
- kIPMFromLEOM = 2;
- kIPMFromMark = 3;
-
- TYPE
- IPMAccessMode = INTEGER;
-
-
- CONST
- kIPMUpdateMsgBit = 4;
- kIPMNewMsgBit = 5;
- kIPMDeleteMsgBit = 6;
-
-
-
- { Values of IPMNotificationType }
- kIPMUpdateMsgMask = $10; {1<<kIPMUpdateMsgBit}
- kIPMNewMsgMask = $20; {1<<kIPMNewMsgBit}
- kIPMDeleteMsgMask = $40; {1<<kIPMDeleteMsgBit}
-
-
-
- TYPE
- IPMNotificationType = Byte;
-
-
- CONST
- { Values of IPMSenderTag }
- kIPMSenderRStringTag = 0;
- kIPMSenderRecordIDTag = 1;
-
- TYPE
- IPMSenderTag = INTEGER;
-
-
- CONST
- kIPMFromDistListBit = 0;
- kIPMDummyRecBit = 1;
- kIPMFeedbackRecBit = 2; { should be redirected to feedback queue }
- kIPMReporterRecBit = 3; { should be redirected to reporter original queue }
- kIPMBCCRecBit = 4; { this recipient is blind to all recipients of message }
-
-
- { Values of OCERecipientOffsetFlags }
- kIPMFromDistListMask = $01; {1<<kIPMFromDistListBit}
- kIPMDummyRecMask = $02; {1<<kIPMDummyRecBit}
- kIPMFeedbackRecMask = $04; {1<<kIPMFeedbackRecBit}
- kIPMReporterRecMask = $08; {1<<kIPMReporterRecBit}
- kIPMBCCRecMask = $10; {1<<kIPMBCCRecBit}
-
-
-
- TYPE
- OCERecipientOffsetFlags = Byte;
-
-
- OCECreatorType = RECORD
- msgCreator: OSType;
- msgType: OSType;
- END;
-
-
-
-
- CONST
- kIPMTypeWildCard = 'ipmw';
-
- kIPMFamilyUnspecified = 0;
- kIPMFamilyWildCard = '????';
-
- { well known signature }
- kIPMSignature = 'ipms'; { base type }
-
- { well known message types }
- kIPMReportNotify = 'rptn'; { routing feedback }
-
- { well known message block types }
- kIPMEnclosedMsgType = 'emsg'; { enclosed (nested) message }
- kIPMReportInfo = 'rpti'; { recipient information }
- kIPMDigitalSignature = 'dsig'; { digital signature }
-
- { Values of IPMMsgFormat }
- kIPMOSFormatType = 1;
- kIPMStringFormatType = 2;
-
-
-
- TYPE
- IPMMsgFormat = INTEGER;
-
- IPMStringMsgType = Str32;
-
- IPMMsgType = RECORD
- format: IPMMsgFormat; { IPMMsgFormat}
- CASE INTEGER OF
- 1: (msgOSType: OCECreatorType);
- 2: (msgStrType: IPMStringMsgType);
- END;
-
-
-
- {
- Following are the known extension values for IPM addresses handled by Apple.
- We define the definition of the entn extension below.
- }
-
- CONST
- kOCEalanXtn = 'alan';
- kOCEentnXtn = 'entn'; { entn = entity name (DSSpec: aka) }
- kOCEaphnXtn = 'aphn';
-
-
-
- {
- Following are the specific definitions for the extension for the standard
- OCEMail 'entn' addresses. [Note, the actual extension is formatted as in
- IPMEntityNameExtension.]
- }
-
- { entn extension forms }
- kOCEAddrXtn = 'addr';
- kOCEQnamXtn = 'qnam';
- kOCEAttrXtn = 'attr'; { an attribute specification }
- kOCESpAtXtn = 'spat'; { specific attribute }
-
- {
- Following are the specific definitions for standard
- OCEMail 'aphn' extension value.
-
- All RStrings here are packed (e.g. truncated to length) and even padded (e.g.
- if length odd, then a pad byte (zero) should be introduced before the next field).
-
- The extension value is in the packed form of the following structure:
- RString phoneNumber;
- RString modemType;
- Str32 queueuName;
-
- The body of phoneNumber compound RString is in the packed form of the following structure:
- short subType;
- RString countryCode; // used when subType == kOCEUseHandyDial
- RString areaCode; // used when subType == kOCEUseHandyDial
- RString phone; // used when subType == kOCEUseHandyDial
- RString postFix; // used when subType == kOCEUseHandyDial
- RString nonHandyDialString; // used when subType == kOCEDontUseHandyDial
- }
-
- { phoneNumber sub type constants }
- CONST
- kOCEUseHandyDial = 1;
- kOCEDontUseHandyDial = 2;
-
-
-
- TYPE
- ProtoOCEPackedRecipient = RECORD
- dataLength: INTEGER;
- END;
-
- CONST
- kOCEPackedRecipientMaxBytes = (4096 - sizeof(ProtoOCEPackedRecipient));
-
-
- TYPE
- OCEPackedRecipient = RECORD
- dataLength: INTEGER;
-
- data: PACKED ARRAY[1..kOCEPackedRecipientMaxBytes] OF Byte;
- END;
- OCEPackedRecipientPtr = ^OCEPackedRecipient;
-
-
- IPMEntnQueueExtension = RECORD
- queueName: Str32;
- END;
-
-
- IPMEntnAttributeExtension = RECORD { kOCEAttrXtn }
- attributeName: AttributeType;
- END;
-
-
- IPMEntnSpecificAttributeExtension = RECORD { kOCESpAtXtn }
- attributeCreationID: AttributeCreationID;
- attributeName: AttributeType;
- END;
-
-
- { All IPM entn extensions fit within the following }
-
- IPMEntityNameExtension = RECORD
- subExtensionType: OSType;
- CASE INTEGER OF
- 1: (specificAttribute: IPMEntnSpecificAttributeExtension);
- 2: (attribute: IPMEntnAttributeExtension);
- 3: (queue: IPMEntnQueueExtension);
- END;
-
-
- { addresses with kIPMNBPXtn should specify this nbp type }
- CONST
- kIPMWSReceiverNBPType = 'MsgReceiver';
-
- TYPE
- IPMMsgID = RECORD
- id: ARRAY[1..4] OF LONGINT;
- END;
-
-
-
- CONST
- { Values of IPMHeaderSelector }
- kIPMTOC = 0;
- kIPMSender = 1;
- kIPMProcessHint = 2;
- kIPMMessageTitle = 3;
- kIPMMessageType = 4;
- kIPMFixedInfo = 7;
-
-
-
- TYPE
- IPMHeaderSelector = Byte;
-
- IPMSender = RECORD
- sendTag: IPMSenderTag;
- CASE INTEGER OF
- 1: (rString: RString);
- 2: (rid: PackedRecordID);
- END;
-
- OCERecipient = DSSpec;
-
-
-
-
-
- {****************************************************************************}
- { Definitions specific to OCEMessaging }
-
- IPMContextRef = LONGINT;
- IPMQueueRef = LONGINT;
- IPMMsgRef = LONGINT;
- IPMSeqNum = LONGINT;
- IPMProcHint = Str32;
- IPMQueueName = Str32;
-
-
- IPMNoteProcPtr = ProcPtr;
- { FUNCTION IPMNoteProcPtr(queue: IPMQueueRef; seqNum: IPMSeqNum;
- notificationType: IPMNotificationType; userData: LONGINT): void;}
-
-
- IPMFixedHdrInfo = PACKED RECORD
- version: INTEGER;
- authenticated: BOOLEAN;
- signatureEnclosed: BOOLEAN; { digital signature enclosed }
- msgSize: LONGINT;
- notification: IPMNotificationType;
- priority: IPMPriority;
- blockCount: INTEGER;
- originalRcptCount: INTEGER; { original number of recipients }
- refCon: LONGINT; { Client defined data }
- reserved: INTEGER;
- creationTime: UTCTime; { Time when it was created }
- msgID: IPMMsgID;
- family: OSType; { family this msg belongs (e.g. mail) }
- END;
-
-
- CONST
- kIPMDeliveryNotificationBit = 0;
- kIPMNonDeliveryNotificationBit = 1;
- kIPMEncloseOriginalBit = 2;
- kIPMSummaryReportBit = 3;
- kIPMOriginalOnlyOnErrorBit = 4; { modify enclose original to only on error }
-
-
-
- kIPMNoNotificationMask = $00;
- kIPMDeliveryNotificationMask = $01; {1<<kIPMDeliveryNotificationBit}
- kIPMNonDeliveryNotificationMask = $02; {1<<kIPMNonDeliveryNotificationBit}
- kIPMDontEncloseOriginalMask = $00;
- kIPMEncloseOriginalMask = $04; {1<<kIPMEncloseOriginalBit}
- kIPMImmediateReportMask = $00;
- kIPMSummaryReportMask = $08; {1<<kIPMSummaryReportBit}
- kIPMOriginalOnlyOnErrorMask = $10; {1<<kIPMOriginalOnlyOnErrorBit}
- kIPMEncloseOriginalOnErrorMask = kIPMOriginalOnlyOnErrorMask + kIPMEncloseOriginalMask;
-
- { standard Non delivery codes }
- kIPMNoSuchRecipient = $0001;
- kIPMRecipientMalformed = $0002;
- kIPMRecipientAmbiguous = $0003;
- kIPMRecipientAccessDenied = $0004;
- kIPMGroupExpansionProblem = $0005;
- kIPMMsgUnreadable = $0006;
- kIPMMsgExpired = $0007;
- kIPMMsgNoTranslatableContent = $0008;
- kIPMRecipientReqStdCont = $0009;
- kIPMRecipientReqSnapShot = $000A;
- kIPMNoTransferDiskFull = $000B;
- kIPMNoTransferMsgRejectedbyDest = $000C;
- kIPMNoTransferMsgTooLarge = $000D;
-
- {***********************************************************************}
- {
- This is the structure that will be returned by enumerate and getmsginfo
- This definition is just to give you a template, the position of msgType
- is variable since this is a packed structure. procHint and msgType are
- packed and even length padded.
- }
- TYPE
- IPMMsgInfo = PACKED RECORD
- sequenceNum: IPMSeqNum;
- userData: LONGINT;
- respIndex: INTEGER;
- padByte: Byte;
- priority: IPMPriority;
- msgSize: LONGINT;
- originalRcptCount: INTEGER;
- reserved: INTEGER;
- creationTime: UTCTime;
- msgID: IPMMsgID;
- family: OSType; { family this msg belongs to (e.g. mail) }
- procHint: IPMProcHint;
- msgType: IPMMsgType;
- END;
-
- IPMBlockType = OCECreatorType;
-
- IPMTOC = RECORD
- blockType: IPMBlockType;
- blockOffset: LONGINT;
- blockSize: LONGINT;
- blockRefCon: LONGINT;
- END;
-
-
-
- {
- The following structure is just to describe the layout of the SingleFilter.
- Each field should be packed and word aligned when passed to the IPM ToolBox.
- }
-
- IPMSingleFilter = PACKED RECORD
- priority: IPMPriority;
- padByte: Byte;
- family: OSType; { family this msg belongs (e.g. mail), '????' for all }
- script: ScriptCode; { Language Identifier }
- hint: IPMProcHint;
- msgType: IPMMsgType;
- END;
-
-
- IPMFilter = RECORD
- count: INTEGER;
- sFilters: ARRAY[1..1] OF IPMSingleFilter;
- END;
-
-
- {***********************************************************************}
- {
- Following structures define the “start” of a recipient report block and the
- elements of the array respectively.
- }
-
- IPMReportBlockHeader = RECORD
- msgID: IPMMsgID; { message id of the original }
- creationTime: UTCTime; { creation time of the report }
- END;
-
-
- OCERecipientReport = RECORD
- rcptIndex: INTEGER; { index of recipient in original message }
- result: OSErr; { result of sending letter to this recipient}
- END;
-
- {***********************************************************************}
- IPMParamHeader = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
- END;
-
-
- IPMOpenContextPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- contextRef: IPMContextRef; { <-- Context reference to be used in further calls}
- END;
-
- IPMCloseContextPB = IPMOpenContextPB;
-
-
- IPMCreateQueuePB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- filler1: LONGINT;
- queue: ^OCERecipient;
- identity: AuthIdentity; { used only if queue is remote }
- owner: ^PackedRecordID; { used only if queue is remote }
- END;
-
- { For createqueue and deletequeue only queue and identity are used }
- IPMDeleteQueuePB = IPMCreateQueuePB;
-
-
- IPMOpenQueuePB = PACKED RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- contextRef: IPMContextRef;
- queue: ^OCERecipient;
- identity: AuthIdentity;
- filter: ^IPMFilter;
- newQueueRef: IPMQueueRef;
- notificationProc: IPMNoteProcPtr;
- userData: LONGINT;
- noteType: IPMNotificationType;
- padByte: Byte;
- reserved: LONGINT;
- reserved2: LONGINT;
- END;
-
-
- IPMCloseQueuePB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- queueRef: IPMQueueRef;
- END;
-
-
- IPMEnumerateQueuePB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- queueRef: IPMQueueRef;
- startSeqNum: IPMSeqNum;
- getProcHint: BOOLEAN;
- getMsgType: BOOLEAN;
- filler: INTEGER;
- filter: ^IPMFilter;
- numToGet: INTEGER;
- numGotten: INTEGER;
- enumCount: LONGINT;
- enumBuffer: Ptr; { will be packed array of IPMMsgInfo }
- actEnumCount: LONGINT;
- END;
-
- IPMChangeQueueFilterPB = IPMEnumerateQueuePB;
-
-
- IPMDeleteMsgRangePB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- queueRef: IPMQueueRef;
- startSeqNum: IPMSeqNum;
- endSeqNum: IPMSeqNum;
- lastSeqNum: IPMSeqNum;
- END;
-
-
-
- IPMOpenMsgPB = PACKED RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- queueRef: IPMQueueRef;
- sequenceNum: IPMSeqNum;
- newMsgRef: IPMMsgRef;
- actualSeqNum: IPMSeqNum;
- exactMatch: BOOLEAN;
- padByte: Byte;
- reserved: LONGINT;
- END;
-
-
-
- IPMOpenHFSMsgPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- hfsPath: ^FSSpec;
- filler: LONGINT;
- newMsgRef: IPMMsgRef;
- filler2: LONGINT;
- filler3: Byte;
- reserved: LONGINT;
- END;
-
-
-
- IPMOpenBlockAsMsgPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- filler: LONGINT;
- newMsgRef: IPMMsgRef;
- filler2: ARRAY[1..7] OF INTEGER;
- blockIndex: INTEGER;
- END;
-
-
-
- IPMCloseMsgPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- deleteMsg: BOOLEAN;
- END;
-
-
-
- IPMGetMsgInfoPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- info: ^IPMMsgInfo;
- END;
-
-
-
- IPMReadHeaderPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- fieldSelector: INTEGER;
- offset: LONGINT;
- count: LONGINT;
- buffer: Ptr;
- actualCount: LONGINT;
- filler: INTEGER;
- remaining: LONGINT;
- END;
-
-
-
- IPMReadRecipientPB = PACKED RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- rcptIndex: INTEGER;
- offset: LONGINT;
- count: LONGINT;
- buffer: Ptr;
- actualCount: LONGINT;
- reserved: INTEGER; { must be zero }
- remaining: LONGINT;
- originalIndex: INTEGER;
- recipientOffsetFlags: OCERecipientOffsetFlags;
- END;
-
-
-
- {
- replyQueue works like recipient. [can no longer read it via ReadHeader]
- OriginalIndex is meaningless, rcptFlags are used seperately and there are
- currently none defined.
- }
- IPMReadReplyQueuePB = IPMReadRecipientPB;
-
-
- IPMGetBlkIndexPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- blockType: IPMBlockType;
- index: INTEGER;
- startingFrom: INTEGER;
- actualBlockType: IPMBlockType;
- actualBlockIndex: INTEGER;
- END;
-
-
-
- IPMReadMsgPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- mode: IPMAccessMode;
- offset: LONGINT;
- count: LONGINT;
- buffer: Ptr;
- actualCount: LONGINT;
- blockIndex: INTEGER;
- remaining: LONGINT;
- END;
-
-
- IPMVerifySignaturePB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- signatureContext: SIGContextPtr;
- END;
-
-
- IPMNewMsgPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- filler: LONGINT;
- recipient: ^OCERecipient;
- replyQueue: ^OCERecipient;
- procHint: StringPtr;
- filler2: INTEGER;
- msgType: ^IPMMsgType;
- refCon: LONGINT;
- newMsgRef: IPMMsgRef;
- filler3: INTEGER;
- filler4: LONGINT;
- identity: AuthIdentity;
- sender: ^IPMSender;
- internalUse: LONGINT;
- internalUse2: LONGINT;
- END;
-
-
- IPMNewHFSMsgPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- hfsPath: ^FSSpec;
- recipient: ^OCERecipient;
- replyQueue: ^OCERecipient;
- procHint: StringPtr;
- filler2: INTEGER;
- msgType: ^IPMMsgType;
- refCon: LONGINT;
- newMsgRef: IPMMsgRef;
- filler3: INTEGER;
- filler4: LONGINT;
- identity: AuthIdentity;
- sender: ^IPMSender;
- internalUse: LONGINT;
- internalUse2: LONGINT;
- END;
-
-
- IPMNestMsgPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- filler: ARRAY[1..9] OF INTEGER;
- refCon: LONGINT;
- msgToNest: IPMMsgRef;
- filler2: INTEGER;
- startingOffset: LONGINT;
- END;
-
-
-
- IPMNewNestedMsgBlockPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- recipient: ^OCERecipient;
- replyQueue: ^OCERecipient;
- procHint: StringPtr;
- filler1: INTEGER;
- msgType: ^IPMMsgType;
- refCon: LONGINT;
- newMsgRef: IPMMsgRef;
- filler2: INTEGER;
- startingOffset: LONGINT;
- identity: AuthIdentity;
- sender: ^IPMSender;
- internalUse: LONGINT;
- internalUse2: LONGINT;
- END;
-
-
-
- IPMEndMsgPB = PACKED RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- msgID: IPMMsgID;
- msgTitle: ^RString;
- deliveryNotification: IPMNotificationType;
- priority: IPMPriority;
- cancel: BOOLEAN;
- padByte: Byte;
- reserved: LONGINT;
- signature: SIGSignaturePtr;
- signatureSize: Size;
- signatureContext: SIGContextPtr;
- family: OSType; { family this msg belongs (e.g. mail) }
- { use kIPMFamilyUnspecified by default }
- END;
-
-
-
- IPMAddRecipientPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- recipient: ^OCERecipient;
- reserved: LONGINT;
- END;
-
-
-
- IPMAddReplyQueuePB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- filler: LONGINT;
- replyQueue: ^OCERecipient;
- END;
-
-
-
- IPMNewBlockPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- blockType: IPMBlockType;
- filler: ARRAY[1..5] OF INTEGER;
- refCon: LONGINT;
- filler2: ARRAY[1..3] OF INTEGER;
- startingOffset: LONGINT;
- END;
-
-
-
- IPMWriteMsgPB = RECORD
- qLink: Ptr;
- reservedH1: LONGINT;
- reservedH2: LONGINT;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- saveA5: LONGINT;
- reqCode: INTEGER;
-
- msgRef: IPMMsgRef;
- mode: IPMAccessMode;
- offset: LONGINT;
- count: LONGINT;
- buffer: Ptr;
- actualCount: LONGINT;
- currentBlock: BOOLEAN;
- END;
-
-
-
-
- IPMParamBlock = RECORD
- CASE INTEGER OF
- 1: (header: IPMParamHeader);
- 2: (openContextPB: IPMOpenContextPB);
- 3: (closeContextPB: IPMCloseContextPB);
- 4: (createQueuePB: IPMCreateQueuePB);
- 5: (deleteQueuePB: IPMDeleteQueuePB);
- 6: (openQueuePB: IPMOpenQueuePB);
- 7: (closeQueuePB: IPMCloseQueuePB);
- 8: (enumerateQueuePB: IPMEnumerateQueuePB);
- 9: (changeQueueFilterPB: IPMChangeQueueFilterPB);
- 10: (deleteMsgRangePB: IPMDeleteMsgRangePB);
- 11: (openMsgPB: IPMOpenMsgPB);
- 12: (openHFSMsgPB: IPMOpenHFSMsgPB);
- 13: (openBlockAsMsgPB: IPMOpenBlockAsMsgPB);
- 14: (closeMsgPB: IPMCloseMsgPB);
- 15: (getMsgInfoPB: IPMGetMsgInfoPB);
- 16: (readHeaderPB: IPMReadHeaderPB);
- 17: (readRecipientPB: IPMReadRecipientPB);
- 18: (readReplyQueuePB: IPMReadReplyQueuePB);
- 19: (getBlkIndexPB: IPMGetBlkIndexPB);
- 20: (readMsgPB: IPMReadMsgPB);
- 21: (verifySignaturePB: IPMVerifySignaturePB);
- 22: (newMsgPB: IPMNewMsgPB);
- 23: (newHFSMsgPB: IPMNewHFSMsgPB);
- 24: (nestMsgPB: IPMNestMsgPB);
- 25: (newNestedMsgBlockPB: IPMNewNestedMsgBlockPB);
- 26: (endMsgPB: IPMEndMsgPB);
- 27: (addRecipientPB: IPMAddRecipientPB);
- 28: (addReplyQueuePB: IPMAddReplyQueuePB);
- 29: (newBlockPB: IPMNewBlockPB);
- 30: (writeMsgPB: IPMWriteMsgPB);
- END;
-
- IPMParamBlockPtr = ^IPMParamBlock;
-
- CONST
- { Request codes }
- kIPMOpenContext = $400;
- kIPMCloseContext = $401;
- kIPMNewMsg = $402;
- kIPMAddRecipient = $403;
- kIPMNewBlock = $404;
- kIPMNewNestedMsgBlock = $405;
- kIPMNestMsg = $406;
- kIPMWriteMsg = $407;
- kIPMEndMsg = $408;
- kIPMOpenQueue = $409;
- kIPMCloseQueue = $40A;
- kIPMOpenMsg = $40B;
- kIPMCloseMsg = $40C;
- kIPMReadMsg = $40D;
- kIPMReadHeader = $40E;
- kIPMOpenBlockAsMsg = $40F;
- kIPMReadRecipient = $410;
- kIPMCreateQueue = $411;
- kIPMDeleteQueue = $412;
- kIPMEnumerateQueue = $413;
- kIPMChangeQueueFilter = $414;
- kIPMDeleteMsgRange = $415;
- kIPMOpenHFSMsg = $417;
- kIPMGetBlkIndex = $418;
- kIPMGetMsgInfo = $419;
-
- kIPMAddReplyQueue = $41D;
- kIPMNewHFSMsg = $41E;
-
- kIPMReadReplyQueue = $421;
- kIPMVerifySignature = $422;
-
-
-
-
- FUNCTION IPMOpenContext(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMOpenContext, _oceTBDispatch;
-
- FUNCTION IPMCloseContext(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMCloseContext, _oceTBDispatch;
-
- FUNCTION IPMNewMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMNewMsg, _oceTBDispatch;
-
- FUNCTION IPMNewBlock(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMNewBlock, _oceTBDispatch;
-
- FUNCTION IPMNewNestedMsgBlock(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMNewNestedMsgBlock, _oceTBDispatch;
-
- FUNCTION IPMNestMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMNestMsg, _oceTBDispatch;
-
- FUNCTION IPMWriteMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMWriteMsg, _oceTBDispatch;
-
- FUNCTION IPMEndMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMEndMsg, _oceTBDispatch;
-
- FUNCTION IPMOpenQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMOpenQueue, _oceTBDispatch;
-
- FUNCTION IPMCloseQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMCloseQueue, _oceTBDispatch;
-
- FUNCTION IPMVerifySignature(paramBlock: IPMParamBlockPtr): OSErr; { Always synchronous }
- INLINE $7000, $1f00, $3F3C, kIPMVerifySignature, _oceTBDispatch;
-
- FUNCTION IPMOpenMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMOpenMsg, _oceTBDispatch;
-
- FUNCTION IPMCloseMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMCloseMsg, _oceTBDispatch;
-
- FUNCTION IPMReadMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMReadMsg, _oceTBDispatch;
-
- FUNCTION IPMReadHeader(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMReadHeader, _oceTBDispatch;
-
- FUNCTION IPMOpenBlockAsMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMOpenBlockAsMsg, _oceTBDispatch;
-
- FUNCTION IPMNewHFSMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMNewHFSMsg, _oceTBDispatch;
-
- FUNCTION IPMReadRecipient(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMReadRecipient, _oceTBDispatch;
-
- FUNCTION IPMReadReplyQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMReadReplyQueue, _oceTBDispatch;
-
- FUNCTION IPMCreateQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMCreateQueue, _oceTBDispatch;
-
- FUNCTION IPMDeleteQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMDeleteQueue, _oceTBDispatch;
-
- FUNCTION IPMEnumerateQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMEnumerateQueue, _oceTBDispatch;
-
- FUNCTION IPMChangeQueueFilter(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMChangeQueueFilter, _oceTBDispatch;
-
- FUNCTION IPMDeleteMsgRange(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMDeleteMsgRange, _oceTBDispatch;
-
- FUNCTION IPMAddRecipient(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMAddRecipient, _oceTBDispatch;
-
- FUNCTION IPMAddReplyQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMAddReplyQueue, _oceTBDispatch;
-
- FUNCTION IPMOpenHFSMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMOpenHFSMsg, _oceTBDispatch;
-
- FUNCTION IPMGetBlkIndex(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMGetBlkIndex, _oceTBDispatch;
-
- FUNCTION IPMGetMsgInfo(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
- INLINE $3F3C, kIPMGetMsgInfo, _oceTBDispatch;
-
-
-
-
- {**************************************************************************************}
- { EXTERNAL ROUTINES }
-
- CONST
- kOCESizePackedRecipient = 830;
- kOCEPackRecipient = 831;
- kOCEUnpackRecipient = 832;
- kOCEStreamRecipient = 833;
- kOCEGetRecipientType = 834;
- kOCESetRecipientType = 835;
-
-
-
- {
- Compute the space that a OCERecipient would take if it were in packed
- form. [Note: does NOT even pad extensionSize, so you may get an odd #back out]
- Safe to pass dereferenced handle(s).
- }
-
- FUNCTION OCESizePackedRecipient(rcpt: OCERecipient): INTEGER;
- INLINE $303C, kOCESizePackedRecipient, $AA5C;
-
-
- {
- Take an OCERecipient (scatter) and (gather) stream into the specified
- buffer. It is assumed that there is sufficient space in the buffer (that is
- OCESizePackedRecipient). Safe to pass dereferenced handle(s).
- }
- FUNCTION OCEPackRecipient(rcpt: OCERecipient; buffer: UNIV Ptr): INTEGER;
- INLINE $303C, kOCEPackRecipient, $AA5C;
-
- {
- Take a packed OCERecipient and cast a the OCERecipient frame over it. Returns
- amBadDestId if it doesn't look like an OCERecipient. Safe to pass dereferenced
- handle(s).
- }
- FUNCTION OCEUnpackRecipient(buffer: UNIV Ptr; VAR rcpt: OCERecipient;
- VAR entitySpecifier: RecordID): OSErr;
- INLINE $303C, kOCEUnpackRecipient, $AA5C;
-
-
- {
- Take an OCERecipient (scatter) and (gather) stream using the specified
- function. Safe to pass dereferenced handle(s). If streamer function returns
- OCEError OCEStreamRecipient stops execution and passes the error back to the caller
- }
-
- TYPE
- OCERecipientStreamer = ProcPtr;
- { FUNCTION OCERecipientStreamer(
- VAR buffer: void; count: LONGINT; eof: BOOLEAN; userData: LONGINT): OSErr;}
-
-
-
- FUNCTION OCEStreamRecipient(rcpt: OCERecipient; stream: OCERecipientStreamer;
- userData: LONGINT; VAR actualCount: LONGINT): OSErr;
- INLINE $303C, kOCEStreamRecipient, $AA5C;
-
-
- { Get the OCERecipient's extensionType. Safe to pass dereferenced handle(s).}
-
- FUNCTION OCEGetRecipientType(cid: CreationID): OSType;
- INLINE $303C, kOCEGetRecipientType, $AA5C;
-
-
- {
- Set the OCERecipient's extensionType in the specified cid. (Note: we do NOT
- check for a nil pointer). If the extensionType is 'entn', the cid is assumed
- to be "valid" and is not touched. Note: to properly handle non 'entn''s this
- routine must and will zero the high LONGINT (source) of the cid! Safe to pass
- dereferenced handle(s).
- }
- PROCEDURE OCESetRecipientType(extensionType: OSType; VAR cid: CreationID);
- INLINE $303C, kOCESetRecipientType, $AA5C;
-
-
- {$ENDC} { UsingOCEMessaging }
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-